<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>benny-sdl-classes: include/Box.h Source File</title>

<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>

</head>
<body>
<div id="top"><!-- do not remove this div! -->


<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  
  
  <td style="padding-left: 0.5em;">
   <div id="projectname">benny-sdl-classes
   
   </div>
   <div id="projectbrief">Benny&#39;s assorted SDL game classes. Does exactly what it says on the can.</div>
  </td>
  
  
  
 </tr>
 </tbody>
</table>
</div>

<!-- Generated by Doxygen 1.7.5.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="annotated.html"><span>Classes</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="files.html"><span>File&#160;List</span></a></li>
      <li><a href="globals.html"><span>File&#160;Members</span></a></li>
    </ul>
  </div>
</div>
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
  initNavTree('_box_8h.html','');
</script>
<div id="doc-content">
<div class="header">
  <div class="headertitle">
<div class="title">include/Box.h</div>  </div>
</div>
<div class="contents">
<a href="_box_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/*</span>
<a name="l00002"></a>00002 <span class="comment">     Copyright (C) 2011 Benny Mackney</span>
<a name="l00003"></a>00003 <span class="comment"></span>
<a name="l00004"></a>00004 <span class="comment">    This program is free software: you can redistribute it and/or modify</span>
<a name="l00005"></a>00005 <span class="comment">    it under the terms of the GNU General Public License as published by</span>
<a name="l00006"></a>00006 <span class="comment">    the Free Software Foundation, either version 3 of the License, or</span>
<a name="l00007"></a>00007 <span class="comment">    (at your option) any later version.</span>
<a name="l00008"></a>00008 <span class="comment"></span>
<a name="l00009"></a>00009 <span class="comment">    This program is distributed in the hope that it will be useful,</span>
<a name="l00010"></a>00010 <span class="comment">    but WITHOUT ANY WARRANTY; without even the implied warranty of</span>
<a name="l00011"></a>00011 <span class="comment">    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the</span>
<a name="l00012"></a>00012 <span class="comment">    GNU General Public License for more details.</span>
<a name="l00013"></a>00013 <span class="comment"></span>
<a name="l00014"></a>00014 <span class="comment">    You should have received a copy of the GNU General Public License</span>
<a name="l00015"></a>00015 <span class="comment">    along with this program.  If not, see &lt;http://www.gnu.org/licenses/&gt;.</span>
<a name="l00016"></a>00016 <span class="comment">*/</span>
<a name="l00017"></a>00017 
<a name="l00018"></a>00018 <span class="preprocessor">#ifndef BOX_H</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="preprocessor">#define BOX_H</span>
<a name="l00020"></a>00020 <span class="preprocessor"></span>
<a name="l00021"></a><a class="code" href="_box_8h.html#a05b2624b726f3c33b268c593f0da9f7a">00021</a> <span class="preprocessor">#define BSC_BOX_NUMBEROFMODES 2</span>
<a name="l00022"></a>00022 <span class="preprocessor"></span>
<a name="l00023"></a>00023 <span class="preprocessor">#include &quot;<a class="code" href="bennysc_8h.html">bennysc.h</a>&quot;</span>
<a name="l00024"></a>00024 <span class="preprocessor">#include &lt;SDL/SDL.h&gt;</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &lt;SDL/SDL_image.h&gt;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &lt;string&gt;</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include &lt;iostream&gt;</span>
<a name="l00028"></a>00028 
<a name="l00029"></a><a class="code" href="class_box.html">00029</a> <span class="keyword">class </span><a class="code" href="class_box.html">Box</a>
<a name="l00030"></a>00030 {
<a name="l00031"></a>00031     <span class="keyword">public</span>:
<a name="l00033"></a>00033 
<a name="l00037"></a>00037         <a class="code" href="class_box.html#aca78d7db44972bfa78d46b7bbc8796f6" title="Default constructor.">Box</a>();
<a name="l00039"></a>00039 
<a name="l00043"></a>00043         <span class="keyword">virtual</span> <a class="code" href="class_box.html#a6a5e09398e85d602a046b429062fb9c2" title="Destructor.">~Box</a>();
<a name="l00044"></a>00044 
<a name="l00046"></a>00046 
<a name="l00052"></a>00052         <span class="keywordtype">void</span> <a class="code" href="class_box.html#a262047af0b6fb0bc3b21d8d26bf74eab" title="Draw the Box.">draw_object</a>(SDL_Surface* screen,SDL_Rect camera);
<a name="l00054"></a>00054 
<a name="l00057"></a>00057         <span class="keyword">virtual</span> <span class="keywordtype">int</span> <a class="code" href="class_box.html#aef168d8226c16322d2778fdf756057bb" title="Empty tick funtion.">tick</a>();
<a name="l00059"></a>00059 
<a name="l00064"></a>00064         <span class="keywordtype">bool</span> <a class="code" href="class_box.html#a71b5039df641d69575cecbcee432147b" title="Rectangular collision detection with other Box objects/derivatives.">collides</a>(<span class="keyword">const</span> <a class="code" href="class_box.html">Box</a>* collider) <span class="keyword">const</span>;
<a name="l00066"></a>00066 
<a name="l00071"></a>00071         <span class="keywordtype">bool</span> <a class="code" href="class_box.html#a71b5039df641d69575cecbcee432147b" title="Rectangular collision detection with other Box objects/derivatives.">collides</a>(<span class="keyword">const</span> SDL_Rect* collider) <span class="keyword">const</span>;
<a name="l00073"></a>00073 
<a name="l00076"></a>00076         Sint16 <a class="code" href="class_box.html#aa4a468fd608291595385d037b201614d" title="Gets the x position of the Box.">get_x</a>() <span class="keyword">const</span>;
<a name="l00078"></a>00078 
<a name="l00081"></a>00081         Sint16 <a class="code" href="class_box.html#abe0987545b605259cb1d7b3a463ec6e1" title="Gets the y position of the Box.">get_y</a>() <span class="keyword">const</span>;
<a name="l00083"></a>00083 
<a name="l00086"></a>00086         Sint16 <a class="code" href="class_box.html#a4e16accb8a43c6ab00066372ffec0536" title="Gets the minimum x position of the Box.">get_x1</a>() <span class="keyword">const</span>;
<a name="l00088"></a>00088 
<a name="l00091"></a>00091         Sint16 <a class="code" href="class_box.html#a41a1bfbf7a88039f2a1eefd181ff56fe" title="Gets the minimum y position of the Box.">get_y1</a>() <span class="keyword">const</span>;
<a name="l00093"></a>00093 
<a name="l00096"></a>00096         Sint16 <a class="code" href="class_box.html#a376ed2bc4b6c2bbbb1a0e40ad7c26815" title="Gets the maximum x position of the Box.">get_x2</a>() <span class="keyword">const</span>;
<a name="l00098"></a>00098 
<a name="l00101"></a>00101         Sint16 <a class="code" href="class_box.html#a32b2d05f1da7f8e5f33767ce7f4f8bfc" title="Gets the maximum y position of the Box.">get_y2</a>() <span class="keyword">const</span>;
<a name="l00103"></a>00103         <span class="keywordtype">void</span> <a class="code" href="class_box.html#aa88ca140376a67872f2f7c1a1c39eb6b" title="Sets the x position of the Box.">set_x</a>(Sint16 x);
<a name="l00105"></a>00105         <span class="keywordtype">void</span> <a class="code" href="class_box.html#a99ffef8e5f7a78611f5650f005594da0" title="Sets the y position of the Box.">set_y</a>(Sint16 y);
<a name="l00107"></a>00107         <span class="keywordtype">void</span> <a class="code" href="class_box.html#a6702cb074e92ec70bc029fb2ff6d62f7" title="Sets the x and y positions of the Box.">set_pos</a>(Sint16 x, Sint16 y);
<a name="l00109"></a>00109         <span class="keywordtype">void</span> <a class="code" href="class_box.html#a9c17a4d538d2ff7ab67f516d607fc3dd" title="Sets the width of the Box.">set_w</a>(Uint16 w);
<a name="l00111"></a>00111         <span class="keywordtype">void</span> <a class="code" href="class_box.html#af7a137e6afa3dde822017522ac635494" title="Sets the height of the Box.">set_h</a>(Uint16 h);
<a name="l00113"></a>00113         <span class="keywordtype">void</span> <a class="code" href="class_box.html#a1f3e245dad98042900c0348103c00a71" title="Sets the width and height of the Box.">set_dimensions</a>(Uint16 w,Uint16 h);
<a name="l00114"></a>00114         SDL_Rect <a class="code" href="class_box.html#ae6616cb4d7d2826e8035aaa6651224a9">get_dimensions</a>();
<a name="l00115"></a>00115         SDL_Rect <a class="code" href="class_box.html#a0a610d3f5ac9bcd251fe98636faea417">get_position</a>();
<a name="l00117"></a>00117 
<a name="l00118"></a>00118         <span class="keywordtype">int</span> <a class="code" href="class_box.html#ab9c5f9eacf32e399b48c932f58704339" title="Loads a sprite and sets it to be used.">load_sprite</a>(<span class="keyword">const</span> <span class="keywordtype">char</span>* path);
<a name="l00120"></a>00120 
<a name="l00122"></a>00122         <span class="keywordtype">int</span> <a class="code" href="class_box.html#a37ffc759ea75c89c6fe2ac3d1d897a2e" title="Sets a sprite to be used.">set_sprite</a>(SDL_Surface* newSprite);
<a name="l00123"></a><a class="code" href="class_box.html#a75ec7af4bf4a011c3636c05e98abb154">00123</a>         SDL_Colour <a class="code" href="class_box.html#a75ec7af4bf4a011c3636c05e98abb154">boxColour</a>;
<a name="l00124"></a>00124         
<a name="l00126"></a>00126 
<a name="l00131"></a>00131         <span class="keywordtype">void</span> <a class="code" href="class_box.html#a5d807c5d4f1cace5416b30be4c3c97f2" title="Sets a mode of the Box.">set_mode</a>(<span class="keywordtype">int</span> mode, <span class="keywordtype">bool</span> val);
<a name="l00133"></a>00133 
<a name="l00137"></a>00137         <span class="keywordtype">bool</span> <a class="code" href="class_box.html#a93f300a67e2c7532497987c4ee68d829" title="Gets the state of a mode of the Box.">get_mode</a>(<span class="keywordtype">int</span> mode) <span class="keyword">const</span>;
<a name="l00138"></a>00138 
<a name="l00140"></a>00140 
<a name="l00147"></a>00147         <span class="keywordtype">void</span> <a class="code" href="class_box.html#a66791c172ec7b6f865448f7935eb4ae4" title="Set box colour.">set_colour</a>(<span class="keywordtype">int</span> r, <span class="keywordtype">int</span> g, <span class="keywordtype">int</span> b);
<a name="l00148"></a>00148 
<a name="l00150"></a>00150 
<a name="l00155"></a>00155         <span class="keywordtype">void</span> <a class="code" href="class_box.html#a66791c172ec7b6f865448f7935eb4ae4" title="Set box colour.">set_colour</a>(SDL_Colour colour);
<a name="l00156"></a>00156         
<a name="l00157"></a>00157         
<a name="l00158"></a><a class="code" href="class_box.html#a2ea13ce4c2a4d9045bdd07b70a2d3b4e">00158</a>         SDL_Rect <a class="code" href="class_box.html#a2ea13ce4c2a4d9045bdd07b70a2d3b4e">boxRect</a>;
<a name="l00159"></a><a class="code" href="class_box.html#ae8a7fb4f1f59a7e8b2baaa66811b1a15">00159</a>         SDL_Rect <a class="code" href="class_box.html#ae8a7fb4f1f59a7e8b2baaa66811b1a15">clipRect</a>;
<a name="l00160"></a><a class="code" href="class_box.html#a3adda3311d61e9a36e6c2ff412e03a82">00160</a>         SDL_Surface* <a class="code" href="class_box.html#a3adda3311d61e9a36e6c2ff412e03a82">sprite</a>;
<a name="l00161"></a>00161 
<a name="l00162"></a>00162     <span class="keyword">protected</span>:
<a name="l00163"></a>00163     <span class="keyword">private</span>:
<a name="l00164"></a>00164         <span class="keywordtype">bool</span> modes[<a class="code" href="_box_8h.html#a05b2624b726f3c33b268c593f0da9f7a" title="The number of modes the Box will store.">BSC_BOX_NUMBEROFMODES</a>];
<a name="l00165"></a>00165 };
<a name="l00166"></a>00166 
<a name="l00167"></a>00167 <span class="preprocessor">#endif // BOX_H</span>
</pre></div></div>
</div>
  <div id="nav-path" class="navpath">
    <ul>
      <li class="navelem"><a class="el" href="_box_8h.html">Box.h</a>      </li>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>


    <li class="footer">Generated on Sun Oct 23 2011 04:30:01 for benny-sdl-classes by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.7.5.1 </li>
   </ul>
 </div>


</body>
</html>
